<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class homeModel extends Model {

    public function getHotProduct() {
        $sql = "SELECT *	
                    FROM product 
                    ORDER BY timeStart DESC
                    LIMIT 5;
                    ";

        $this->_setSql($sql);
        $hotProducts = $this->getAll();

        if (empty($hotProducts)) {
            return false;
        }
        return $hotProducts;
    }

    public function getOutProduct() {
        $sql = "SELECT *	
                    FROM product 
                    ORDER BY timeStart DESC
                    LIMIT 5;
                    ";

        $this->_setSql($sql);
        $hotProducts = $this->getRow();

        if (empty($hotProducts)) {
            return false;
        }
        return $hotProducts;
        
    }

    public function getNewProduct() {
        $sql = "SELECT *	
                    FROM product 
                    ORDER BY timeStart DESC
                    LIMIT 5;
                    ";

        $this->_setSql($sql);
        $hotProducts = $this->getAll();

        if (empty($hotProducts)) {
            return false;
        }
        return $hotProducts;
        
    }
}

?>
